package com.ruoyi.shop.popularize.groupon.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.common.mapper.DtsGrouponMapper;
import com.ruoyi.mall.common.domain.DtsGroupon;
import com.ruoyi.shop.popularize.groupon.service.IDtsGrouponService;

/**
 * 团购活动Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-11
 */
@Service
public class DtsGrouponServiceImpl implements IDtsGrouponService 
{
    @Autowired
    private DtsGrouponMapper dtsGrouponMapper;

    /**
     * 查询团购活动
     * 
     * @param id 团购活动主键
     * @return 团购活动
     */
    @Override
    public DtsGroupon selectDtsGrouponById(Long id)
    {
        return dtsGrouponMapper.selectDtsGrouponById(id);
    }

    /**
     * 查询团购活动列表
     * 
     * @param dtsGroupon 团购活动
     * @return 团购活动
     */
    @Override
    public List<DtsGroupon> selectDtsGrouponList(DtsGroupon dtsGroupon)
    {
        return dtsGrouponMapper.selectDtsGrouponList(dtsGroupon);
    }

    /**
     * 新增团购活动
     * 
     * @param dtsGroupon 团购活动
     * @return 结果
     */
    @Override
    public int insertDtsGroupon(DtsGroupon dtsGroupon)
    {
        return dtsGrouponMapper.insertDtsGroupon(dtsGroupon);
    }

    /**
     * 修改团购活动
     * 
     * @param dtsGroupon 团购活动
     * @return 结果
     */
    @Override
    public int updateDtsGroupon(DtsGroupon dtsGroupon)
    {
        dtsGroupon.setUpdateTime(DateUtils.getNowDate());
        return dtsGrouponMapper.updateDtsGroupon(dtsGroupon);
    }

    /**
     * 批量删除团购活动
     * 
     * @param ids 需要删除的团购活动主键
     * @return 结果
     */
    @Override
    public int deleteDtsGrouponByIds(Long[] ids)
    {
        return dtsGrouponMapper.deleteDtsGrouponByIds(ids);
    }

    /**
     * 删除团购活动信息
     * 
     * @param id 团购活动主键
     * @return 结果
     */
    @Override
    public int deleteDtsGrouponById(Long id)
    {
        return dtsGrouponMapper.deleteDtsGrouponById(id);
    }
}
